package com.java98k.admin.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class AdminController {

    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "test")
    public String test() {
        return "test";
    }

    @GetMapping(value = "login")
    public String login(String account, String password) {

        return restTemplate.getForObject("http://service-admin-01/login?name="+account,String.class);
    }
}
